Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(reactivity): make items in a readonly&reactive map trigger effects #1794

Closed
wants to merge 2 commits into from
Closed

Conversation

unbyte
Copy link
Contributor

@unbyte unbyte commented Aug 6, 2020

fixed the problem:
assume that a map has two proxies, one of which is readonly and the other is reactive, if we modify items in the map by the reactive one proxy, watcher callbacks on the readonly one won't work, as discussed in #1772, which can be a very common usage scenario for map.

however changed the strategy on handling a reactive and readonly map at the same time.

return get(
this,
key,
isReactive(this) ? value => toReadonly(toReactive(value)) : toReadonly
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can pass the above test case without changing here :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh It's the problem with my test cases. I will rewrite it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi I've rewritten the test case: it should be an object in the map.

@unbyte
Copy link
Contributor Author

unbyte commented Aug 6, 2020

solved by ed43810

@unbyte unbyte closed this Aug 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants